<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var str = '[{"a":2},{"a":5}]'
        var str1 = str.replace(/^\W/,"");
        var str2 = str1.replace(/\W$/,"");
        var arr = str2.split(",")
        console.log(arr)
        var obj = JSON.parse(arr[1]);
        console.log(obj)

    </script>
</body>
</html>